<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
</head>
<body>
<div class="ui container" style="margin-top: 40px;">
    <form class="ui form" method="post" th:action="@{/admin/edit}" th:object="${userCruds}">
        <input type="hidden" name="id" th:value="*{id}">
        <div class="field">
            <label>姓名</label>
            <input type="text" name="name" th:value="*{name}" placeholder="姓名" required autofocus>
        </div>
        <!--<span th:text="${message}" style="color: red"></span>-->
        <div class="field">
            <label>年龄</label>
            <input type="text" name="age" th:value="*{age}" placeholder="年龄" required>
        </div>
        <div class="field">
            <label>性别</label>
            <!--<input type="text" name="sex" placeholder="性别" required>-->
            <div class="ui fluid selection dropdown">
                <input type="hidden" name="sex" th:value="*{sex}" required>
                <i class="dropdown icon"></i>
                <div class="default text" th:value="*{sex}"></div>
                <div class="menu">
                    <div class="item" data-value="男">男</div>
                    <div class="item" data-value="女">女</div>
                </div>
            </div>
        </div>
        <div class="field">
            <label>班级</label>
            <input type="text" name="classes" th:value="*{classes}" placeholder="班级" required>
        </div>
        <div class="field">
            <label>地址</label>
            <input type="text" name="address" th:value="*{address}" placeholder="地址" required>
        </div>
        <button class="ui button right" type="submit">修改</button>
    </form>
    <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
        <div class="header">提示：</div>
        <p th:text="${message}"></p>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<script>
    /*选择列表*/
    $('.ui.dropdown').dropdown({
        on: 'hover'
    });
</script>
</body>
</html>